Msg("====Main module initialized...\n")

function gSAM.GetPlayer(name)
	for k,v in pairs(player.GetAll()) do
		if string.find(string.lower(v:Name()),string.lower(name)) == 1 then
			return v
		end
	end
end

function gSAM.GetMapList()
	local maps = {}
	for k,v in pairs(file.Find("../maps")) do
		if string.Right(v,4) == ".bsp" then
			table.insert(v,maps)
		end
	end
	return maps or false
end

function gSAM.Restart()
	game.ConsoleCommand("restart")
end

function gSAM.HintPlayer(ply,text)
	ply:SendLua("GAMEMODE:AddNotify(\""..text.."\", NOTIFY_GENERIC, 5); surface.PlaySound( \"".."ambient/water/drip"..math.random(1, 4)..".wav".."\" )") 
	ply:PrintMessage(HUD_PRINTCONSOLE,text)
end

function gSAM.ChangeMap(map)
	if map then
		game.ConsoleCommand("map "..map)
	end
end

function gSAM.PlayerIsInSystem(ply)
	if !(gSAM.GetPlayerConfigTable(ply:SteamID())) then
		return false
	end
	return true
end
